/**
 * 
 */
package neptune.web.client.commands;

import neptune.web.client.view.HistoryTokenUtils;
import neptune.web.client.view.OperativeView;
import neptune.web.client.view.SuperView;
import neptune.web.client.view.UserView;
import neptune.web.client.view.ViewManager;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.History;

/**
 * @author Roberto Bifulco [info@robertobifulco.it, robertobifulco.it]
 *
 */
public class UserSummaryCommand implements Command {

	/* (non-Javadoc)
	 * @see com.google.gwt.user.client.Command#execute()
	 */
	public void execute() {
		SuperView operative = (SuperView) ViewManager.getViewManager().getViewByName(
				OperativeView.DEFAULT_TOKEN);
		
		UserView user = (UserView) operative.getViewByName(UserView.DEFAULT_TOKEN);
		user.reset();
		user.update();
		
		History.newItem(HistoryTokenUtils.buildToken(OperativeView.DEFAULT_TOKEN,
		UserView.DEFAULT_TOKEN));
	}

}
